package dmt16.TelemetrySuit.UI
{
	import dmt16.TelemetrySuit.Controller.SensorTypes.GenericSensor;
	import dmt16.TelemetrySuit.Controller.SensorTypes.SensorEvent;
	
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFormat;
	
	import flashx.textLayout.formats.TextAlign;
	import dmt16.TelemetrySuit.UI.Tiles.TileBase;

	public class GenericSensorTile extends TileBase
	{
		private var _sensor:GenericSensor;	
		private var txtFront:TextField;
		
		public function GenericSensorTile(sensor:GenericSensor)
		{
			super(sensor);
			
			sensor.addEventListener(SensorEvent.SENSOR_DATA_EVENT,_onSensorData);
			txtFront=new TextField();
			txtFront.defaultTextFormat=new TextFormat("_sans",30,0xFF33CCFF,true,null,null,null,null,TextAlign.CENTER);
			Sprite(tileContent).addChild(txtFront);
			txtFront.x=-txtFront.width/2;
			txtFront.y=-15;
			txtFront.selectable=false;
			Sprite(tileContent).graphics.lineStyle(8,0xFF33CCFF);
			Sprite(tileContent).graphics.drawCircle(0,0,40);
		}
		
		private function _onSensorData(event:SensorEvent):void{
			
		}
	}
}